package cn.bdqn.controller;

import cn.bdqn.entity.Role;
import cn.bdqn.service.RoleService;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.annotation.Resource;
import java.util.List;

@Controller
@RequestMapping("/role")
public class RoleController {
    @Resource
    RoleService roleService;

    @RequestMapping("/findAllRoles")
    @ResponseBody
    public List<Role> findAllRoles(){
        List<Role> roles = roleService.findAllRoles();
        return roles;
    }
}
